package com.guanjian.netty.learning.netty;

import io.netty.channel.Channel;
import io.netty.channel.ChannelHandler;
import io.netty.channel.ChannelInitializer;

/**
 * created by guanjian on 2019/10/9 16:54
 */
public class EchoServerChannelInitializer extends ChannelInitializer {
    private ChannelHandler channelHandler;

    public EchoServerChannelInitializer(ChannelHandler channelHandler) {
        this.channelHandler = channelHandler;
    }

    @Override
    protected void initChannel(Channel channel) throws Exception {
        channel.pipeline().addLast(channelHandler);
    }
}
